<!DOCTYPE html>
<html>
<head>
	<title>出现最多的次数</title>
</head>
<body>
<script type="text/javascript">
	
	let str = 'abcssaasesas';
	let o = {};
	let max = 0, s = str[0];
	for (let i = 0; i < str.length; i++) {
		if(o[str[i]]) {
			o[str[i]]++;
		} else {
			o[str[i]] = 1;
		}
	}
	console.log(o)
	for (let key in o) {
		if(max < o[key]) {
			max = o[key];
			s = key;
		}
	}
	console.log(s)

</script>
</body>
</html>